package leetcode_501_600;

import java.util.Arrays;

public class LeeCode_506 {
    public static void main(String[] args) {

    }
    private static String[] findRelativeRanks(int[] score) {
        int n = score.length;
        String[] ans = new String[n];
        Integer[] is = new Integer[n];
        for (int i = 0; i < n; i++) {
            is[i] = i;
        }
        Arrays.sort(is, (o1, o2) -> score[o2] - score[o1]);
        ans[is[0]] = "Gold Medal";
        if (is.length == 1)
            return ans;
        ans[is[1]] = "Silver Medal";
        if (is.length == 2)
            return ans;
        ans[is[2]] = "Bronze Medal";
        if (is.length == 3)
            return ans;
        for (int i = 3; i < n; i++) {
            ans[is[i]] = Integer.toString(i + 1);
        }
        return ans;
    }
}
